package org.xg.study.pd.model.vo;

import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author CMG
 * @version 1.0
 * @className EngineResult
 * @description 决策结果
 * @date 2021/9/14 21:26
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EngineResult {
    /**
     * 执行结果
     */
    private boolean isSuccess;
    /**
     * 用户ID
     */
    private String userId;
    /**
     * 规则树ID
     */
    private Long treeId;
    /**
     * 果实节点ID
     */
    private Long nodeId;
    /**
     * 果实节点值
     */
    private String nodeValue;

    public EngineResult(String userId, Long treeId, Long nodeId,
                        String nodeValue) {
        this.userId = userId;
        this.treeId = treeId;
        this.nodeId = nodeId;
        this.nodeValue = nodeValue;
    }

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
